#pragma once
#include "MediaSource.h"
#include "rtp.h"

namespace jlh
{
	class H264Source :public MediaSource
	{
	public:
		static H264Source* CreateNew(uint32_t framerate=25);
		virtual ~H264Source();

		void SetFramerate(uint32_t framerate)
		{
			framerate_ = framerate;
		}

		uint32_t GetFramerate() const
		{
			return  framerate_;
		}

		std::string GetMediaDescription(uint16_t port ) override;
		std::string GetAttribute() override;
		bool HandleFrame(MediaChannelId channelId, AVFrame frame) override;

		static uint32_t GetTimestamp();
	private:
		H264Source(uint32_t framerate);

	private:
		uint32_t framerate_ = 25;
	};
}


